package com.spstudio.iforward.front;

import java.io.Serializable;

import javax.enterprise.inject.Model;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Model
public class Story implements Serializable, Cloneable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8706367447731840608L;

	private int id;
	@NotNull(message = "标题不能为空")
	@Size(min = 1, max = 150, message = "标题应在1-150个字符之间")
	private String title;
	@NotNull(message = "内容不能为空")
	@Size(min = 1, max = 65535, message = "内容应在1-65535个字符之间")
	private String content;
	private int categoryId;
	@NotNull(message = "评论不能为空")
	@Size(min = 1, max = 500, message = "评论应在1-500个字符之间")
	private String comment;
	private String categoryName;
	private long publishDate;
	private String publishDateString;
	private int ranking;
	private String thumbnailPath;
	private String itemSource;
	private int preStoryId;
	private int nextStoryId;
	
	public Story clone() {
		try{
			return (Story)super.clone();
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public int getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	public String getCategoryName() {
		return categoryName;
	}
	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	public long getPublishDate() {
		return publishDate;
	}
	public void setPublishDate(long publishDate) {
		this.publishDate = publishDate;
	}
	public int getRanking() {
		return ranking;
	}
	public void setRanking(int ranking) {
		this.ranking = ranking;
	}
	public String getPublishDateString() {
		return publishDateString;
	}
	public void setPublishDateString(String publishDateString) {
		this.publishDateString = publishDateString;
	}
	public String getThumbnailPath() {
		return thumbnailPath;
	}
	public void setThumbnailPath(String thumbnailPath) {
		this.thumbnailPath = thumbnailPath;
	}
	public String getItemSource() {
		return itemSource;
	}
	public void setItemSource(String itemSource) {
		this.itemSource = itemSource;
	}
	public int getPreStoryId() {
		return preStoryId;
	}
	public void setPreStoryId(int preStoryId) {
		this.preStoryId = preStoryId;
	}
	public int getNextStoryId() {
		return nextStoryId;
	}
	public void setNextStoryId(int nextStoryId) {
		this.nextStoryId = nextStoryId;
	}

}
